import request from '@/utils/request'

// 查询评论列表
export function listComment(query) {
  return request({
    url: '/admin/comment/list',
    method: 'get',
    params: query
  })
}

// 查询评论详细
export function getComment(commentId) {
  return request({
    url: '/admin/comment/' + commentId,
    method: 'get'
  })
}

// 新增评论
export function addComment(data) {
  return request({
    url: '/admin/comment',
    method: 'post',
    data: data
  })
}

// 删除评论
export function delComment(commentId) {
  return request({
    url: '/admin/comment/' + commentId,
    method: 'delete'
  })
}

// 审核通过评论
export function approveComment(commentId, reviewRemark) {
  return request({
    url: '/admin/comment/approve',
    method: 'put',
    data: {
      commentId: commentId,
      reviewRemark: reviewRemark
    }
  })
}

// 驳回评论
export function rejectComment(commentId, reviewRemark) {
  return request({
    url: '/admin/comment/reject',
    method: 'put',
    data: {
      commentId: commentId,
      reviewRemark: reviewRemark
    }
  })
}

// 同步评论到APP
export function syncComment(commentId) {
  return request({
    url: '/admin/comment/sync/' + commentId,
    method: 'put'
  })
} 